package com.starsola.util;

import java.util.HashMap;

public class ContentText {

    public static String METHOD = "method";

    public static ThreadLocal<HashMap<String, Object>> threadLocal = new ThreadLocal<>();

    public static <T> T setVal(String key, Object val) {
        HashMap<String, Object> map = threadLocal.get();
        if (map == null) {
            map = new HashMap<>();
            threadLocal.set(map);
        }
        return (T) map.put(key, val);
    }

    public static <T> T getVal(String key) {
        HashMap<String, Object> map = threadLocal.get();

        if (map == null) {
            return null;
        }
        return (T)map.get(key);
    }


}
